<?php


namespace App\Http\Controllers\applets\model;


use Illuminate\Support\Facades\DB;

class SendTeacherModel
{
    public static function add($param){
        return DB::table('t_send_teacher')->insert($param);
    }

    public static function queryFirst($where,$field){
        return DB::table('t_send_teacher')->where($where)->first($field);
    }

    public static function queryAll($where){
        return DB::table('t_send_teacher as s')
            ->leftJoin('t_admin as a','s.parent_id','=','a.id')
            ->where($where)
            ->get(['s.id','s.sn_value','s.name','s.create_time','s.batch_rand','a.username']);
    }

    public static function delete($where){
        return DB::table('t_send_teacher')->where($where)->delete();
    }

    public static function edit($where,$param){
        return DB::table('t_send_teacher')->where($where)->update($param);
    }
}